<?php
/**
 * Created by PhpStorm.
 * User: qingyun
 * Date: 17/12/23
 * Time: 上午9:38
 */

namespace app\home\controller;
use think\Controller;
use Db;
header("Content-type: text/html; charset=utf-8");


class comment extends Controller
{
    public function comment()
    {
        return view();
    }
    public function input(){
        //把获取到的内容添加到comment字段中

        $data['comment']=input('?post.commodity1')?input('post.commodity1/s'):'';
        $data['service']=input('?post.commodity2')?input('post.commodity2/s'):'';
        $data['miaoshu']=input('?post.star')?input('post.star/s'):'';
        foreach ($data as $k => $v){
            if (empty($v) || !isset($v)){

                unset($data[$k]);
            }
        }

//        $data['addTime']=time();
        //实例化add模型，调用saveData方法
        return model('add')->saveData($data);

    }
    function saveStar(){
        $data=input('post.');
        return model('add')->saveStar($data);

    }





}